package com.xinqi.modules.prepare.prepare.controller.inner;

import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.Param;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.prepare.prepare.dto.req.PrepareOperateLogQueryDTO;
import com.xinqi.modules.prepare.prepare.dto.rsp.PrepareOperateLogResultDTO;
import com.xinqi.modules.prepare.prepare.service.PrepareOperateLogService;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 备课区操作记录表内部控制层
 *
 * @author: system
 * @date: 2023/03/19
 */
@Hidden
@RestController
@RequestMapping("/inner/prepare-operate-log")
@RequiredArgsConstructor
public class PrepareOperateLogInnerController {
    private final PrepareOperateLogService prepareOperateLogService;

    /**
     * 备课区操作记录表-分页
     */
    @GetMapping("/page")
    public R<PageInfo<PrepareOperateLogResultDTO>> page(Param pageable, PrepareOperateLogQueryDTO dto) {
        PageInfo<PrepareOperateLogResultDTO> page = prepareOperateLogService.page(pageable, dto);
        return R.data(page);
    }

    /**
     * 备课区操作记录表-详情
     */
    @GetMapping("/{id}")
    public R<PrepareOperateLogResultDTO> findById(@PathVariable("id") Long id) {
        PrepareOperateLogResultDTO dto = prepareOperateLogService.findById(id);
        return R.data(dto);
    }
}
